package com.blue.base.oauth.sso.storage;

import com.alibaba.cloud.sentinel.annotation.SentinelRestTemplate;
import com.blue.base.sentinel.util.FeignSentinelExceptionUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * 启动类
 *
 * @author liulei
 * @version 1.0
 */
@Slf4j
@EnableDiscoveryClient
@SpringCloudApplication
public class SsoOrder {

    @Bean
    @SentinelRestTemplate(blockHandler = "handleException", blockHandlerClass = FeignSentinelExceptionUtil.class)
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    public static void main(String[] args) {
        SpringApplication.run(SsoOrder.class, args);
        log.info("{} is started!", SsoOrder.class.getSimpleName());
    }
}



